﻿@inject NavigationManager NavigationManager
@inject IDataCacheService _dataCacheService

<CnGalWebSite.Components.Containers.MasaTitleContainer Title="登入QQ号" Icon="fa fa-fw fa-qq" Class="h-100">
    <div style="display: flex; flex-direction: column; justify-content: space-between;">
        <span>@(string.IsNullOrWhiteSpace(Model.QQAccountName) ? "绑定后可以使用QQ进行登入" : ("QQ昵称：" + Model.QQAccountName))</span>

        <div style="display: flex; justify-content: flex-end;">
            <div>
                <MButton Text Block  OnClick="OnClick" Color="primary">
                    <MIcon Left>    @(string.IsNullOrWhiteSpace(Model.QQAccountName) ? "mdi-link-variant" : "mdi-link-variant-plus ")</MIcon>
                    @(string.IsNullOrWhiteSpace(Model.QQAccountName) ? "绑定" : "更换绑定")
                </MButton>

            </div>
        </div>
    </div>
</CnGalWebSite.Components.Containers.MasaTitleContainer>

@code {
    [Parameter]
    public EditUserDataViewModel Model { get; set; } = new EditUserDataViewModel();

    public void OnClick()
    {
        NavigationManager.NavigateTo(ToolHelper.GetThirdPartyLoginUrl(ToolHelper.Base64EncodeUrl(NavigationManager.Uri), ThirdPartyLoginType.QQ));

        
    }
}
